home *** CD-ROM | disk | FTP | other *** search
/ Enter 2004 February / EnterCD 02_2004.iso / Gry / Arcade! Classic Arcade Pack 2.0 / Arcade.EXE / $PROGRAMFILES / Arcade! Classic Arcade Pack / pong.swf / scripts / frame_5 / DoAction.as
Encoding:
Text File  |  2003-12-05  |  1.6 KB  |  65 lines

  1. setProperty("/ball", _X, getProperty("/ball", _X) + speedx);
  2. setProperty("/ball", _Y, getProperty("/ball", _Y) + speedy);
  3. if(gamebottom - ballsize < getProperty("/ball", _Y) or getProperty("/ball", _Y) < gametop + ballsize)
  4. {
  5.    speedy = - speedy;
  6.    if(!random("8") and (pause == "30" or pause == "0"))
  7.    {
  8.       speedx = - speedx;
  9.    }
  10.    if(pause == "30" or pause == "0")
  11.    {
  12.       tellTarget("/sound")
  13.       {
  14.          gotoAndStop("pong");
  15.          play();
  16.       }
  17.    }
  18. }
  19. if(getProperty("/ball", _X) < gameleft)
  20. {
  21.    if(pause)
  22.    {
  23.       pause -= "1";
  24.    }
  25.    else
  26.    {
  27.       p1score += "1";
  28.       tellTarget("/p1score")
  29.       {
  30.          nextFrame();
  31.       }
  32.       call("nextball");
  33.    }
  34. }
  35. else if(gameright < getProperty("/ball", _X))
  36. {
  37.    if(pause)
  38.    {
  39.       pause -= "1";
  40.    }
  41.    else
  42.    {
  43.       p2score += "1";
  44.       tellTarget("/p2score")
  45.       {
  46.          nextFrame();
  47.       }
  48.       call("nextball");
  49.    }
  50. }
  51. if("12" < getProperty("/ball", _X) and getProperty("/ball", _X) < "18" and getProperty("/paddle1", _Y) - "30" < getProperty("/ball", _Y) and getProperty("/ball", _Y) < getProperty("/paddle1", _Y) + "30" or "382" < getProperty("/ball", _X) and getProperty("/ball", _X) < "388" and getProperty("/paddle2", _Y) - "30" < getProperty("/ball", _Y) and getProperty("/ball", _Y) < getProperty("/paddle2", _Y) + "30")
  52. {
  53.    speedx = - speedx;
  54.    if(!random("8"))
  55.    {
  56.       speedy = - speedy;
  57.    }
  58.    tellTarget("/sound")
  59.    {
  60.       gotoAndStop("ping");
  61.       play();
  62.    }
  63. }
  64. startDrag("/paddle3","0","-10","0","-10","300");
  65.